Skip to content

Allow dir (and other proprety) override in build_html_enclosing_tag.#21

Open
inaimathi wants to merge 7 commits intonbessi:masterfrom
inaimathi:master
Open

Allow dir (and other proprety) override in build_html_enclosing_tag.#21
inaimathi wants to merge 7 commits intonbessi:masterfrom
inaimathi:master

Conversation

@inaimathi
Copy link

@inaimathi inaimathi commented Apr 10, 2025

Before this change:

>>> import pyhiccup.core
>>> pyhiccup.core.html("hello there")
'<!DOCTYPE html>\n<html dir="rtl" lang="en" xml:lang="en">hello there</html>'
>>> pyhiccup.core.html("hello there", dir="ltr")
'<!DOCTYPE html>\n<html dir="rtl" lang="en" xml:lang="en">hello there</html>'
>>> 

Note that the output still contains dir="rtl" instead of accepting the input value of dir. This is a result of the function core.html not passing kwargs to its call of build_html_enclosing_tag (see the line affected by this commit).

After this change:

>>> import pyhiccup.core
>>> pyhiccup.core.html("hello there")
'<!DOCTYPE html>\n<html dir="rtl" lang="en" xml:lang="en">hello there</html>'
>>> pyhiccup.core.html("hello there", dir="ltr")
'<!DOCTYPE html>\n<html dir="ltr" lang="en" xml:lang="en">hello there</html>'
>>> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant